﻿using System;

namespace Zo.Common
{
    /// <summary>
    ///
    /// </summary>
    public class OrderNumberBuilder
    {
        public static string BuildByHashCode()
        {
            var orderNumber = DateTime.Now.ToFileTime();

            var lastCode = Guid.NewGuid().ToString().GetHashCode();

            if (lastCode < 0)
            {
                lastCode = -lastCode;
            }

            return (orderNumber.ToString() + lastCode.ToString("0000000")).Substring(0, 25);
        }
    }
}